package com.chatdating.mapper;

import com.chatdating.entity.dto.MatchDto;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LikeUserMapper {

    @Select("select u.* from like_user_form as luf join user as u on luf.like_user_id = u.id where luf.uid = #{userId}")
    List<MatchDto> findAll(Integer userId);

    @Delete("DELETE FROM like_user_form WHERE uid = #{userId} AND like_user_id = #{likeUserId}")
    void deleteOne(@Param("userId") Integer userId,@Param("likeUserId") Integer likeUserId);

    @Insert("insert into like_user_form (uid,like_user_id) values(#{userId},#{likeUserId}) ")
    void addOne(@Param("userId") Integer userId,@Param("likeUserId")  Integer likeUserId);
}
